home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3c / getnetent.z / getnetent
Encoding:
Text File  |  2002-10-03  |  8.8 KB  |  199 lines

  1.  
  2.  
  3.  
  4. GGGGEEEETTTTNNNNEEEETTTTEEEENNNNTTTT((((3333NNNN))))                                                    GGGGEEEETTTTNNNNEEEETTTTEEEENNNNTTTT((((3333NNNN))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      getnetent, getnetent_r, fgetnetent, fgetnetent_r, getnetbyaddr,
  10.      getnetbyaddr_r, getnetbyname, getnetbyname_r, setnetent, endnetent - get
  11.      network entry
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<nnnneeeettttddddbbbb....hhhh>>>>
  15.  
  16.      ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ggggeeeettttnnnneeeetttteeeennnntttt((((vvvvooooiiiidddd))));;;;
  17.  
  18.      ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ggggeeeettttnnnneeeetttteeeennnntttt____rrrr((((ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****nnnneeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
  19.  
  20.      ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ffffggggeeeettttnnnneeeetttteeeennnntttt((((FFFFIIIILLLLEEEE ****))));;;;
  21.  
  22.      ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ffffggggeeeettttnnnneeeetttteeeennnntttt____rrrr((((FFFFIIIILLLLEEEE ****,,,, ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****nnnneeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
  23.  
  24.      ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ggggeeeettttnnnneeeettttbbbbyyyynnnnaaaammmmeeee((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee))));;;;
  25.  
  26.      ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ggggeeeettttnnnneeeettttbbbbyyyynnnnaaaammmmeeee____rrrr((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee,,,, ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****nnnneeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
  27.  
  28.      ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ggggeeeettttnnnneeeettttbbbbyyyyaaaaddddddddrrrr((((lllloooonnnngggg nnnneeeetttt,,,, iiiinnnntttt ttttyyyyppppeeee))));;;;
  29.  
  30.      ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****ggggeeeettttnnnneeeettttbbbbyyyyaaaaddddddddrrrr____rrrr((((lllloooonnnngggg nnnneeeetttt,,,, iiiinnnntttt ttttyyyyppppeeee,,,, ssssttttrrrruuuucccctttt nnnneeeetttteeeennnntttt ****nnnneeeennnntttt,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuuffffssssiiiizzzzeeee))));;;;
  31.  
  32.      vvvvooooiiiidddd sssseeeettttnnnneeeetttteeeennnntttt((((iiiinnnntttt ssssttttaaaayyyyooooppppeeeennnn))));;;;
  33.  
  34.      vvvvooooiiiidddd eeeennnnddddnnnneeeetttteeeennnntttt((((vvvvooooiiiidddd))));;;;
  35.  
  36. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  37.      _G_e_t_n_e_t_e_n_t, _f_g_e_t_n_e_t_e_n_t, _g_e_t_n_e_t_b_y_n_a_m_e, _g_e_t_n_e_t_b_y_a_d_d_r and each of their
  38.      reentrant counterparts each return a pointer to an object with the
  39.      following structure containing the broken-out fields of a line in the
  40.      network data base file, /_e_t_c/_n_e_t_w_o_r_k_s, or some other back-end networks
  41.      database.
  42.  
  43.           struct    netent {
  44.                char      *n_name;  /* official name of net */
  45.                char      **n_aliases;   /* alias list */
  46.                int       n_addrtype;    /* net number type */
  47.                unsigned long  n_net;         /* net number */
  48.           };
  49.  
  50.      The members of this structure are:
  51.  
  52.      n_name      The official name of the network.
  53.  
  54.      n_aliases   A zero terminated list of alternate names for the network.
  55.  
  56.      n_addrtype  The type of  the  network  number  returned;  currently  only
  57.                  AF_INET.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GGGGEEEETTTTNNNNEEEETTTTEEEENNNNTTTT((((3333NNNN))))                                                    GGGGEEEETTTTNNNNEEEETTTTEEEENNNNTTTT((((3333NNNN))))
  71.  
  72.  
  73.  
  74.      n_net       The network number.  Network numbers are returned in  machine
  75.                  byte order.
  76.  
  77.      _G_e_t_n_e_t_e_n_t reads the next line of the file, opening the file if necessary.
  78.  
  79.      _S_e_t_n_e_t_e_n_t opens and rewinds the file.  If the _s_t_a_y_o_p_e_n flag is  non-zero,
  80.      the  net  data base will not be closed after each call to _g_e_t_n_e_t_b_y_n_a_m_e or
  81.      _g_e_t_n_e_t_b_y_a_d_d_r.
  82.  
  83.      _E_n_d_n_e_t_e_n_t closes the file.
  84.  
  85.      _G_e_t_n_e_t_b_y_n_a_m_e and _g_e_t_n_e_t_b_y_a_d_d_r sequentially search from the  beginning  of
  86.      the  file  until a matching net name or net address and type is found, or
  87.      until EOF is encountered.  Network numbers are supplied in host order.
  88.  
  89.      The routines fgetnetent and fgetnetent_r will return the next line in the
  90.      supplied file parsed into a struct netent structure.  The file must be in
  91.      the same format as the /_e_t_c/_n_e_t_w_o_r_k_s file.
  92.  
  93.      The routines getnetent, fgetnetent, getnetbyaddr,  and  getnetbyname  all
  94.      return  pointers  into  static  space  which  is  modified  on each call.
  95.      Reentrant   versions   of   each   routine   getnetent_r,   fgetnetent_r,
  96.      getnetbyaddr_r  and getnetbyname_r.  These routines parse the result into
  97.      supplied space.  They each take  a  pointer  to  a  netent  structure,  a
  98.      pointer to some buffer, and a length for the buffer.
  99.  
  100.      The routines documented in this file only parse files of the format given
  101.      in  networks(4).   These  can  be  static files on the system such as the
  102.      /_e_t_c/_n_e_t_w_o_r_k_s file, or files supplied dynamically by the  nsd(1M)  daemon
  103.      from some other backend database such as NIS.
  104.  
  105. NNNNOOOOTTTTEEEE
  106.      The Mips ABI specifies nothing but local files so applications which wish
  107.      to use anything else must compile with libc prior to libnsl in the
  108.      library list.
  109.  
  110.      When nsd is running changes in the local networks file may not be noticed
  111.      by getnetent() until the enumeration cache file has timed out.
  112.  
  113. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  114.      All functions that return struct netent * will return a null (0) pointer
  115.      in the case of EOF or failure.
  116.  
  117. FFFFIIIILLLLEEEESSSS
  118.      /etc/networks /var/ns/cache/networks.byname.m
  119.      /var/ns/cache/networks.byaddr.m
  120.  
  121. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  122.      nsd(1M), networks(4)
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. GGGGEEEETTTTNNNNEEEETTTTEEEENNNNTTTT((((3333NNNN))))                                                    GGGGEEEETTTTNNNNEEEETTTTEEEENNNNTTTT((((3333NNNN))))
  137.  
  138.  
  139.  
  140. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  141.      Null pointer (0) returned on EOF or error.
  142.  
  143. BBBBUUUUGGGGSSSS
  144.      Only Internet network numbers are currently understood.
  145.  
  146.      Expecting network numbers to fit in no more than 32 bits is probably
  147.      naive.
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.